var express = require('express');
var router = express.Router();
const {query} = require('./models/db');

router.get('/', async (req, res) => {
    try {
        const results = await query('SELECT * FROM kaikeba.prog');
        res.render('index', {title: '首页', prog: results});
    } catch (err) {
        console.log(err);
        next(err);
    }
});

module.exports = router;
